﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Transactions;
using T.FAS.Runtime.DataModel.Dao;
using T.FAS.Runtime.Metadata.Entity.DataModel;
using T.FAS.Runtime.Metadata.Entity;
using Newtonsoft.Json;

namespace T.FAS.Runtime.DataModel.Dao
{

    /// <summary>
    /// 数据对象差异比较结果
    /// </summary>
    public class DataObjectCompareResult
    {
        public DataColumnCompareResult DataColumnCompareResult { get; set; } 

        public DataObjectIndexCompareResult DataObjectIndexCompareResult { get; set; }

        public DataObjectParalanguageCompareResult ParalanguageCompareResult { get; set; }
    }

    /// <summary>
    /// 列差异比较结果
    /// </summary>
    public class DataColumnCompareResult
    {
        /// <summary>
        /// 需要新增的列
        /// </summary>
        public List<DataColumn> NeedAddColumns { get; set; } = new List<DataColumn>();
        /// <summary>
        /// 需要删除的列
        /// </summary>
        public List<DataColumn> NeedDropColumns { get; set; } = new List<DataColumn>();
        /// <summary>
        /// 需要修改的列
        /// </summary>
        public List<ModifyColumnInfo> NeedModifyColumns { get; set; } = new List<ModifyColumnInfo>();
    }

    /// <summary>
    /// 索引差异比较结果
    /// </summary>
    public class DataObjectIndexCompareResult
    {
        /// <summary>
        /// 需要新增的列
        /// </summary>
        public List<DataObjectIndex> NeedAddIndexs { get; set; } = new List<DataObjectIndex>();
        /// <summary>
        /// 需要删除的列
        /// </summary>
        public List<DataObjectIndex> NeedDropIndexs { get; set; } = new List<DataObjectIndex>();
        /// <summary>
        /// 需要修改的索引
        /// </summary>
        public List<DataObjectIndex> NeedModifyIndexs { get; set; } = new List<DataObjectIndex>();
    }

    public class DataObjectParalanguageCompareResult
    {
        public bool IsChanged { get; set; }
        public List<string> ChangedParalanguage { get; set; }
    }

    public class ModifyColumnInfo
    {
        public int ChangeTypeLayer { get; set; }
        public DataColumn NewColumn { get; set; }
    }

}
